package org.dromara.solonplugins.job.test2.service;

import org.dromara.solonplugins.job.IJobCallback;
import org.dromara.solonplugins.job.JobInfo;
import org.dromara.solonplugins.job.test2.job.JobDemo3;
import org.noear.solon.annotation.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Job日志服务
 *
 * @author: aoshiguchen
 */
@Component
public class JobLogService implements IJobCallback {

    private static final Logger log = LoggerFactory.getLogger(JobDemo3.class);

    /**
     * 执行日志
     * @param jobInfo Job信息
     * @param param 执行时的Job参数
     * @param throwable 执行Job产生的异常
     */
    @Override
    public void executeLog(JobInfo jobInfo, String param, Throwable throwable) {
        log.info("业务方自己处理job执行日志 jobId:{} jobName:{} param:{} err:{}", jobInfo.getId(), jobInfo.getName(), param, throwable);
    }

}
